package br.com.binding.client.bind.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import br.com.binding.client.bind.annotations.values.WhenText;

/**
 * This annotation represents the binding between <b>any</b> text component and 
 * a model property.  
 * @author Marcelo Emanoel
 */
@Target(value = ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface TextBind {
	/**
	 * The name of the property that should be binded.
	 * @return
	 */
	String name();
	
	/**
	 * Tells when the change event should be fired.
	 * @return
	 */
	WhenText when() default WhenText.ON_KEY_UP;

	/**
	 * The name of the model property of the view.
	 * @return
	 */
	String model();
}